﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
using BusinessLogic;

namespace CarService
{
    public partial class Service : System.Web.UI.Page
    {
        private string ServiceURL
        {
            get
            {
                try
                {
                    return Request.QueryString["Dichvu"];
                }
                catch (System.Exception)
                {
                    return "";
                }
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Load_Data();
            }
        }

        private void Load_Data()
        {
            SettingInfo settingInfo = SettingData.SelectBySiteID(Config.Global.Settings.SiteID);
            ServiceBusiness serviceBusiness = new ServiceBusiness();
            int serviceID = serviceBusiness.SelectServiceID(ServiceURL);
            ServiceInfo serviceInfo= ServiceData.SelectByServiceID(serviceID);

            Page.Title = serviceInfo.ServiceName + " - " + settingInfo.SiteURL;
            Page.MetaDescription = settingInfo.SiteDescription;
            Page.MetaKeywords = settingInfo.SiteKeyword;

            lblTitle.Text = serviceInfo.ServiceName;
            lblContent.Text = serviceInfo.ServiceContent;
            lblDesc.Text = serviceInfo.ServiceDescription;
        }
    }
}